<extend name="Public:template" />
<block name="page_header">
	<ul class="header-sub">
		<li class="previous"><a href="#" class="btn btn-default active" role="button" onClick="javascript:window.history.back(-1);return false;"><span class="icon icon-chevron-left"></span>返回</a></li>
		<li ><h3>提交订单</h3></li>
		<li class="next "><a href="#" class="btn btn-warning active" role="button"  onclick="doOrder();return false;">提交订单</a></li>
	</ul>
</block>
<block name="page_body">
<ul class="list-group mt5">
	<li class="list-group-item greenGraBg">
		<h5 class="list-group-item-text ">第一步：填写配送地址</h5>
	<li>
	<li class="list-group-item">
		<form class="list-group-item-text" action="{:U('Tuangou/doOrder')}" method="post" name="form_add" id="form_add">
			<input type="hidden" name="address_add_flag" value="{$address.add_flag}">
			<input type="hidden" name="prod_id" value="{$itemDetail.prod_id}">
			<input type="hidden" name="num" value="{$itemDetail.num}">
			<div class="input-group">
				<div class="input-group-addon alert-success"><span class="icon icon-user"></span></div>
				<input type="text" class="form-control" name="cust_name" placeholder="请输入收货人姓名" style="padding-left:5px;" value="{$address.name}">
			</div>
			<div class="input-group  mt5">
				<div class="input-group-addon alert-success"><span class="icon icon-tel"></span></div>
				<input type="tel" class="form-control" name="cust_mobile" placeholder="请输入收货人手机或电话" style="padding-left:5px;" value="{$address.mobile}">
			</div>
			<div class="input-group  mt5">
				<div class="input-group-addon alert-success"><span class="icon icon-home"></span></div>
				<input type="text" class="form-control" name="cust_address" placeholder="请输入您的收货地址" style="padding-left:5px;" value="{$address.address}">
			</div>
			<div class="input-group  mt5">
				<div class="input-group-addon alert-success"><span class="icon icon-time"></span></div>
				<select name="cust_free_time" class="form-control" style="padding-left:5px" >
					<volist name="sendTime" id="val">
						<option value="{$val.title}">{$val.title}</option>
					</volist>
				</select>
			</div>		
			<div class=" mt5">
				<textarea name="cust_bak"  class="form-control" placeholder="预购区商品，最快次日发货，如果有特殊要求可在这里填写">{$address.content}</textarea>
			</div>
		</form>
	</li>
</ul>
<ul class="list-group mt5">
	<li class="list-group-item yellowGraBg">
		<h5 class="list-group-item-text">第二步：检查商品清单</h5>
	<li>
	<li class="list-group-item">
		<div class="row clearfix">
			<div class="col-xs-8 col-sm-8">{$itemDetail.title} <label class="label label-info">{$itemDetail.prod_spec}</label></div>
			<div class="col-xs-2 col-sm-2"><span  class="pull-right">¥{$itemDetail.price_real}</span></div>
			<div class="col-xs-2 col-sm-2"><span class="alert-info pull-right" style="border-radius:10px;padding:1px 3px;">×{$itemDetail.num}</span></div>
		</div>
	</li>
	<li class="list-group-item  clearfix">
		<p class="pull-right price">	
			总共<span class="text-danger" >{$itemDetail.num}</span>件，商品总价：<span class="now">¥{$itemDetail.total_amt|number_format=###, 2,'.',''}</span>
		</p>
	</li>
	<li class="list-group-item  clearfix">
		<p class="pull-right">
			免费配送		
		</p>
	</li>
</ul>
<div class="row mt5 clearfix">
	<div class="col-xs-4 col-sm-4"><a href="javascript:window.history.back(-1);" class="btn btn-default active" role="button">返回修改</a></div>
	<div class="col-xs-8 col-sm-8"><a href="#" class="btn btn-warning btn-block active" role="button" onclick="doOrder();return false;">第三步：提交订单</a></div>
</div>
</block>
<block name="script_footer">
<script type="text/javascript">
function doOrder(){
	
	var formObj = document.forms["form_add"];
	var formElsObj = formObj.elements;
	if(formElsObj['cust_name'].value==''){
		alert('收货人名称不能为空');
		return false;
	}
	if(formElsObj['cust_mobile'].value==''){
		alert('联系电话或手机不能为空');
		return false;
	}
	if(formElsObj['cust_address'].value==''){
		alert('配送地址不能为空');
		return false;
	}
	if(formElsObj['num'].value==''||formElsObj['num'].value==0){
		alert('请返回修改商品数量');
		return false;
	}
	formObj.submit();
}

</script>
</block>
